<?

include_once "accesscontrol.php";

if($price == '0')
{
	$qp = "select free, CompanyEmail from job_employer_info where ename = \"$_SESSION[ename]\" ";
	$rp = mysql_query($qp) or die(mysql_error());
	$ap = mysql_fetch_array($rp);

	if($ap[0] == '1')
	{
		echo "<br><br><br><center> You already used your free employer plan. <br> Now you know how powerfull are our system <br> and came the moment you must pay<br> to continue using our services.<br><br>Please, go <a class=TN href=pay1.php> back </a> and choose the plan you like. <br><br>Thank you.</center>";
	
		include_once('../footer.php');
		exit;
	}
	else
	{
		$qu = "update job_employer_info set free = '1' ";
		$ru = mysql_query($qu) or die(mysql_error());
	}

$q1 = "update job_employer_info set plan = \"$_POST[plan]\", JS_number = \"$_POST[reviews]\", JP_number = \"$_POST[postings]\" where ename = \"$_SESSION[ename]\"";
$r1 = mysql_query($q1) or die(mysql_error());

$to = $ap[1];
$subject = "Your employer plan at $_SERVER[HTTP_HOST]";
$message = " Hello,\n here is your employer plan information at $_SERVER[HTTP_HOST]:\n\n Plan name: $plan\n Number of resume viewing: $reviews\n Number of Job Offer postings: $postings\n\n$_SERVER[HTTP_HOST] Team";
$from = "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>";

mail($to, $subject, $message, $from);

echo "<br><br><br><center> Now you can view $reviews resumes<br> and can post $postings job offers. </center>";

}
?>

<? include_once('../footer.php'); ?>